package com.nbers.springcloud.microservice.entity;

import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableField;

import java.io.Serializable;

import com.baomidou.mybatisplus.annotation.*;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import com.fasterxml.jackson.annotation.JsonInclude;
import lombok.Data;

/**
 * @auther 代码生成器
 * @create 2020-04-17
 * @describe 实体类
 */
@Data
@TableName("item")
@JsonInclude(JsonInclude.Include.NON_NULL)
@ApiModel(value = "Item对象", description = "")
public class Item extends Model<Item> {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "主键")
    @TableId("id")
    private String id;

    @ApiModelProperty(value = "标题")
    @TableField("title")
    private String title;

    @ApiModelProperty(value = "内容")
    @TableField("content")
    private String content;

    @ApiModelProperty(value = "图片路径")
    @TableField("img")
    private String img;

    @ApiModelProperty(value = "创建时间")
    @TableField("create_time")
    private String createTime;


    @Override
    protected Serializable pkVal() {
        return this.id;
    }

    public Item() {

    }

    public Item(String id, String title, String content, String img, String createTime) {
        this.id = id;
        this.title = title;
        this.content = content;
        this.img = img;
        this.createTime = createTime;
    }
}